//数据统计-体验列表
App.util.ns('Admin.Experience.Experience');
App.pages.add((function(){
    var NS = Admin.Experience.Experience;
    var page = new App.Page({
        name: 'experience/experience/index'
    });
    //页面初始化
    page.initStack.add('dataTable', function(){
        //面包屑导航
        this.setBreadcrumb([{
            icon: '<i class="fa fa-bar-chart-o"></i>',
            content: '数据统计'
        }, {
            content: '体验记录'
        }]);
        this.dataTable = new App.DataTable({
            baseUrl: '/admin/experience/experience',
            dataUrl: 'lists',
            table: {
                id: 'id',
                main: 0,
                showId: false,
                columns: App.util.copy(NS.Conf.columns)
            },
            filter: [
                {type: 'keywords'},
                {type: 'timeRange'},
                {type: 'select', name: 'status', title: '体验状态', width: '100px', items: [
                    [1, '体验中'],
                    [2, '体验完'],
                    [3, '不良记录'],
                    [4, '已解决'],
                    [5, '扫码进详情']
                ]}
            ],
            menu: [
                //{parent: 'view', permission: 'op:admin.experience.experience.detail'},
                //{parent: 'edit', permission: 'op:admin.experience.experience.update'},
                {parent: 'drop', permission: 'op:admin.experience.experience.delete'},
                {
                    type: 'inline', permission: 'op:admin.experience.experience.checked',
                    name: '完成', operation: {type: 'change', url: 'checked'},
                    conditions: [['status', '1']]
                },
                {
                    type: 'inline', permission: 'op:admin.experience.experience.checking',
                    name: '回滚', operation: {type: 'change', url: 'checking'},
                    conditions: [['status', '2']]
                },
                {
                    type: 'inline', permission: 'op:admin.experience.experience.solve',
                    name: '已解决', operation: {type: 'change', url: 'solve'},
                    conditions: [['status', '3']]
                },
                {parent: 'multiDrop', permission: 'op:admin.experience.experience.multiDelete'},
                {parent: 'oplog', permission: 'op:admin.experience.experience.getOpLogs'}
            ],
            detail: {
                form: {
                    items: App.util.copy(NS.Conf.form)
                }
            }
        }, page);
        this.dataTable.fix(this.contentContainer);
        this.dataTable.loadData();
    });
    //页面刷新
    page.refreshStack.add('dataTable', function(){
        this.dataTable.loadData(true);
    });
    //页面销毁
    page.destroyStack.add('dataTable', function(){
        this.dataTable.destroy();
    });
    return page;
})());